#include "restart.h"
#include "ui_restart.h"
#include "enums.h"

extern int offensiveMovePlayer;

restart::restart(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::restart)
{
    ui->setupUi(this);
    this->setFixedSize(320,100);
    this->setWindowTitle("重开");
    if(offensiveMovePlayer==playerblack){
       ui->label_2->setText("当前先手：黑方");
    }else{
       ui->label_2->setText("当前先手：白方");
    }
}

restart::~restart()
{
    delete ui;
}

void restart::on_pushButton_clicked()
{
    emit sendrestartmsg(ui->checkBox->checkState());
    this->close();
}


void restart::on_pushButton_2_clicked()
{
    this->close();
}


void restart::on_pushButton_3_clicked()
{
    QApplication *q;
    q->quit();
}

